{% extends "qa_base.html" %}

{% block content %}
<div id="wrapper">
    <div id="room">
        <div id="CALeft">
		
			<div class="tabBar">
				<div class="headQuestions">               
                    {{head}} 
				</div>
			</div>
            <div id="listA">
                {% for question in question_list %}
                <div class="short-summary">
                    <div class="counts">
                        <div class="votes">
                            <div class="item-count">
                                {{question.vote_count}}
                            </div>
                            <div>
                                票
                            </div>
                            </div >
                            <div  class="status  answered">
                                <div class="item-count">
                                    {{question.answered_count}}
                                </div>
                                <div>
                                    回答
                                </div>
                            </div>
                            <div class="views">
                                <div class="item-count">
                                    {{question.view_count}}
                                </div>
                                <div>
                                    浏览
                                </div>
                            </div>
                        </div>
                        <div class="question-summary-wrapper">
                            <h2><a href="/qa/questions/{{question.id}}/" title = '{{question.title}}'>{{question.title}}</a></h2>
                            <div class="userinfo">  
                       发表于 <span class="relativetime" title="{{question.question_datetime}}">{{question.question_datetime|timesince}}</span>前   by
                                <a href="/qa/questions/users/{{question.questioner.id}}/">{{question.questioner.name}}</a>
                            </div>
                            <div class="tags">
                                {% for tag in question.tags.all %} <a class="tag-link-"+{{tag.name}} href="/qa/tags/{{tag.name}}"
                                title="查看有关 '{{tag.name}}'" rel="tag">{{tag.name|slice:':14'}}{%if tag.name|length >= 14 %}..{%endif%}</a>
                                {% endfor %}
                            </div>
                        </div>
                    </div>
                    {% empty %}
                    <p><h3>{{message}}</h3></p>
                    {% endfor %}
              </div>
        </div>
        
        <div id="CARight">
        {% if not T %}
            <div class="boxC">
                <h3>热门标签</h3>
                <div class='tags' id='hot-tags'>
                {% for tag in tag_list %}
                <a rel="tag" class="tag-link-{{tag.name}}"  title="see questions tagged '{{tag.name}}'" href="/qa/tags/{{tag.name}}/">{{tag.name|slice:':20'}}{%if tag.name|length >= 20 %}..{%endif%}</a>  
                <span class="tag-number">× {{tag.count}}</span>                
                <br/>
                {% endfor %}
                </div>
             </div>   
       {% endif %}       
        </div>
            <div id="tail" style="clear:both;">
                <div class="pager">
                    <p class="paginator" >
              {% if not T %}
                        {% if LastNum >= 1 %}
                       <span class="next"><a href="/qa/questions{% if unanswered %}/unanswered{% endif %}/pages/{{LastNum}}" title="上一页">&laquo; 上一页</a></span>
                        {% endif %}
                        {% for PageNum in PageList%}
                        {% if PageNum == CurrentNum %}
                        <span class="curr this_page" >{{PageNum}}</span>
                        {% else %}
                        <a class="page" href="/qa/questions{% if unanswered %}/unanswered{% endif %}/pages/{{PageNum}}" >{{PageNum}}</a>
                        {% endif %}
                        {% endfor %}
                        {% if NextNum <= PageTotalNum %}
                        <span class="next"><a href="/qa/questions{% if unanswered %}/unanswered{% endif %}/pages/{{NextNum}}" title="下一页">下一页 &raquo;</a></span>                    
                    	{% endif %}  
              {% else %}
              			{% if PageList %}
               			{% if LastNum >= 1 %}
                       <span class="next"><a href="/qa/tags/{{Tag.name}}/?page={{LastNum}}" title="上一页">&laquo; 上一页</a></span>
                        {% endif %}
                        {% for PageNum in PageList%}
                        {% if PageNum == CurrentNum %}
                        <span class="curr this_page" >{{PageNum}}</span>
                        {% else %}
                        <a class="page" href="/qa/tags/{{Tag.name}}/?page={{PageNum}}" >{{PageNum}}</a>
                        {% endif %}
                        {% endfor %}
                        {% if NextNum <= PageTotalNum %}
                        <span class="next"><a href="/qa/tags/{{Tag.name}}/?page={{NextNum}}" title="下一页">下一页 &raquo;</a></span>                    
                    	{% endif %}  
                        {% endif %}
              {% endif%}  
                    </p>
                </div>
                <!--
                <div class="pagesize">
                    <div class="paginator">
                        <span class="text">每页显示：</span><span class="page"><a href="/questions/?sort=有效&pagesize=15">15</a></span><span class="curr">30</span><span class="page"><a href="/questions/?sort=有效&pagesize=50">50</a></span>
                    </div>
                </div>
                -->
            </div>
        </div>
        <div class="spacer3"></div>
    </div>
    {% endblock %}
